//
//  oldSingleServiceIconView.m
//  laonianbang
//
//  Created by 勇拓 李 on 18/3/21.
//  Copyright © 2018年 zaiyou. All rights reserved.
//

#import "oldSingleServiceIconView.h"
#import "UIImageView+oldImageView.h"

@interface oldSingleServiceIconView()
@property (weak, nonatomic) IBOutlet UIImageView *img_icon;
@property (weak, nonatomic) IBOutlet UILabel *label_title;

@end

@implementation oldSingleServiceIconView

- (void)awakeFromNib
{
    [super awakeFromNib];
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(serviceTapped:)];
    
    [self addGestureRecognizer:tap];
}

- (void)setService:(oldService *)service
{
    _service = service;
    [_img_icon showImage:service.icon];
    _label_title.text = service.cname;
}

- (void)serviceTapped:(id)sender
{
    if (self.service.childList) {
        [self.delegate changeSubView:_service.childList index:_index];
    }
    else
    {
        [self.delegate singleIconViewTapped:_service];
    }
}

@end
